package cn.flying.cloud.flow.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;

import cn.flying.cloud.flow.bo.FwModelerInfoBo;

/**
 * 流程模型信息表
 *
 * @author admin
 * @since 2025-09-24 22:32:54
 */
@TableName("fw_modeler_info")
public class FwModelerInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 模型ID
     */
    @TableField("modeler_id")
    private String modelerId;

    /**
     * 模型key
     */
    @TableField("modeler_key")
    private String modelerKey;

    /**
     * 模型名称
     */
    @TableField("modeler_name")
    private String modelerName;

    /**
     * 模型描述
     */
    @TableField("modeler_desc")
    private String modelerDesc;

    /**
     * 类别
     */
    @TableField("modeler_category")
    private String modelerCategory;

    /**
     * 版本号
     */
    @TableField("modeler_version")
    private String modelerVersion;

    /**
     * 模型xml文件
     */
    @TableField("modeler_xml")
    private String modelerXml;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

    /**
     * 租户号
     */
    @TableField("tenant_id")
    private String tenantId;

    /**
     * 乐观锁
     */
    @TableField(value = "revision", fill = FieldFill.INSERT)
    @Version
    private Long revision;

    /**
     * 删除标识
     */
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @TableLogic
    private String deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getModelerId() {
        return modelerId;
    }

    public void setModelerId(String modelerId) {
        this.modelerId = modelerId;
    }

    public String getModelerKey() {
        return modelerKey;
    }

    public void setModelerKey(String modelerKey) {
        this.modelerKey = modelerKey;
    }

    public String getModelerName() {
        return modelerName;
    }

    public void setModelerName(String modelerName) {
        this.modelerName = modelerName;
    }

    public String getModelerDesc() {
        return modelerDesc;
    }

    public void setModelerDesc(String modelerDesc) {
        this.modelerDesc = modelerDesc;
    }

    public String getModelerCategory() {
        return modelerCategory;
    }

    public void setModelerCategory(String modelerCategory) {
        this.modelerCategory = modelerCategory;
    }

    public String getModelerVersion() {
        return modelerVersion;
    }

    public void setModelerVersion(String modelerVersion) {
        this.modelerVersion = modelerVersion;
    }

    public String getModelerXml() {
        return modelerXml;
    }

    public void setModelerXml(String modelerXml) {
        this.modelerXml = modelerXml;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public Long getRevision() {
        return revision;
    }

    public void setRevision(Long revision) {
        this.revision = revision;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "FwModelerInfo{" +
                "id = " + id +
                ", modelerId = " + modelerId +
                ", modelerKey = " + modelerKey +
                ", modelerName = " + modelerName +
                ", modelerDesc = " + modelerDesc +
                ", modelerCategory = " + modelerCategory +
                ", modelerVersion = " + modelerVersion +
                ", modelerXml = " + modelerXml +
                ", remark = " + remark +
                ", createdBy = " + createdBy +
                ", createdTime = " + createdTime +
                ", updatedBy = " + updatedBy +
                ", updatedTime = " + updatedTime +
                ", tenantId = " + tenantId +
                ", revision = " + revision +
                ", deleted = " + deleted +
                "}";
    }

    public FwModelerInfoBo toBO() {
        FwModelerInfoBo bo = new FwModelerInfoBo();
        bo.setId(this.id);
        bo.setModelerId(this.modelerId);
        bo.setModelerKey(this.modelerKey);
        bo.setModelerName(this.modelerName);
        bo.setModelerDesc(this.modelerDesc);
        bo.setModelerCategory(this.modelerCategory);
        bo.setModelerVersion(this.modelerVersion);
        bo.setModelerXml(this.modelerXml);
        bo.setRemark(this.remark);
        bo.setCreatedBy(this.createdBy);
        bo.setCreatedTime(this.createdTime);
        bo.setUpdatedBy(this.updatedBy);
        bo.setUpdatedTime(this.updatedTime);
        bo.setTenantId(this.tenantId);
        bo.setRevision(this.revision);
        bo.setDeleted(this.deleted);
        return bo;
    }

    public FwModelerInfo fromBO(FwModelerInfoBo bo) {
        this.setId(bo.getId());
        this.setModelerId(bo.getModelerId());
        this.setModelerKey(bo.getModelerKey());
        this.setModelerName(bo.getModelerName());
        this.setModelerDesc(bo.getModelerDesc());
        this.setModelerCategory(bo.getModelerCategory());
        this.setModelerVersion(bo.getModelerVersion());
        this.setModelerXml(bo.getModelerXml());
        this.setRemark(bo.getRemark());
        this.setCreatedBy(bo.getCreatedBy());
        this.setCreatedTime(bo.getCreatedTime());
        this.setUpdatedBy(bo.getUpdatedBy());
        this.setUpdatedTime(bo.getUpdatedTime());
        this.setTenantId(bo.getTenantId());
        this.setRevision(bo.getRevision());
        this.setDeleted(bo.getDeleted());
        return this;
    }
}
